<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>

<div class="middle padtop10 myclear">
	<div class="page-content">
		<!-- bread crumb -->
		<p id="bread-crumb">
			<a href="<?php echo site_url();?>">
				<?php echo $lang['home']?>
			</a>
			<a href="<?php echo site_url('budget/agency/?gid='.$user->groupid);?>">
				<?php echo $lang['agency']?>
			</a>
			<a href="<?php echo site_url('budget/user/?uid='.$user->user_id);?>">
				<?php echo $user->username;?>
			</a>
			<?php echo $info->payment_key;?>
		</p>
		<!-- end bread crumb -->
		<br />
		<?php if($info->type == 1){?>
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="pay-dbydate-title">
					<h2><?php echo $lang['date_detail'];?></h2>
				</td>
				
				<td class="pay-dbydate-time" style="vertical-align:middle;text-align:right">
					<?php printf($lang['toform'], $prevDay->format('d-m-Y'), $dayView->format('d-m-Y'));?>
				</td>
			</tr>
		</table>
		<table class="tbl-list martop20" width="100%" border="1" >
			<tr>
				<td class="td-label" width="120">
					<p><strong><?php echo $lang['ad_code'];?></strong></p>
				</td>
				
				<td class="td-label" >
					<p><strong><?php echo $lang['ad_name']?></strong></p>
				</td>
				
				<td class="td-label text-right" width="150">
					<p><strong><?php echo $lang['detail']?></strong> (Click)</p>
				</td>
				
				<td class="td-label text-right" width="150">
					<p><strong><?php echo $lang['money_num']?></strong> (VNĐ)</p>
				</td>
			</tr>

			<?php $totalMoney = 0; foreach($logs as $paid){ $totalMoney += $paid['adval'];?>
			<tr>
				<td>
					<?php echo $paid['bannerId'];?>
				</td>
				
				<td>
					<?php echo $paid['bannername'];?> 
				</td>
				
				<td class="text-right">
					<?php echo number_format($paid['click']);?>
				</td>
				
				<td class="text-right">
					<?php echo number_format($paid['adval']);?>
				</td>
									
			</tr>
			<?php }?>
			
			<tr>
				<td colspan="3" class="pay-dbydate-total bold text-right">
					<?php echo $lang['sum_before_tax']?>:
				</td>
				
				<td class="pay-dbydate-total text-right bold">
					<?php echo number_format($totalMoney);?>
				</td>
			</tr>
			<tr>
				<td colspan="3" class="pay-dbydate-total bold text-right">
					<?php echo $lang['tax_vat']?>:
				</td>
				
				<td class="pay-dbydate-total text-right bold">
					<?php echo number_format($totalMoney*0.1);?>
				</td>
			</tr>
			<tr>
				<td colspan="3" class="pay-dbydate-total bold text-right">
					<?php echo $lang['sum_after_tax']?>:
				</td>
				
				<td class="pay-dbydate-total text-right bold">
					<?php echo number_format($totalMoney + $totalMoney*0.1);?>
				</td>
			</tr>
		</table>
		
		<br /><br /><br /><br /><br />
		<?php }?>
		<p class="text-right pad10">
			<img class="cursor-pointer" alt="" src="/images/top.gif" onclick="window.scrollTo(0,0); return false;"/>
		</p>
	</div>
</div>